var t = getApp()
var ad = require('../../utils/ad')
Component({
	pageLifetimes: {
		show: function () {
			'function' == typeof this.getTabBar &&
				this.getTabBar() &&
				this.getTabBar().setData({
					selected: 0
				})
		}
	},
	properties: {},
	data: {
		toView: '',
		config_base_list: [],
		config_data_list: [],
		faq: [],
		customAdUnitId: ad.adConfig.customAdUnitId
	},
	methods: {
		onLoad: function (t) {
			var a = this
			setTimeout(function () {
				a.setData({
					toView: t.into
				})
			}, 500)
		},
		onShow: function () {
			this.setData({
				config_base_list: t.globalData.config_base_list,
				config_data_list: t.globalData.config_data_list
			})
		},
		adLoad: function () {
			ad.handleCustomAd.onLoad()
		},
		adError: function (err) {
			ad.handleCustomAd.onError(err)
		},
		adClose: function () {
			ad.handleCustomAd.onClose()
		}
	}
})
